---@class Table_EffectItem
local Table_EffectItem = class("Table_EffectItem");

function Table_EffectItem:ctor()
    self.Id = 0;    --唯一ID
    self.Path = "";    --Prefab路径或ModelID
    self.DelayTime = 0;    --特效延迟时间
    self.IsOnlyDeactive = false;    --是否播放完只失效(0销毁，1不销毁只失效）
    self.Pos = "";    --位置坐标
    self.Rota = "";    --旋转坐标
    self.Duration = 0;    --持续时间 0代表循环
end

function Table_EffectItem:Load(reader)
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.Id = tonumber(self.temp); end
    self.Path = reader:ReadString();
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.DelayTime = tonumber(self.temp); end
    self.IsOnlyDeactive = reader:ReadBool();
    self.Pos = reader:ReadString();
    self.Rota = reader:ReadString();
    self.temp = reader:ReadShortString();
    if not Utility.IsNullOrEmpty(self.temp) then self.Duration = tonumber(self.temp); end
    self.temp = nil;
end

---@class Table_EffectMgr : IDataMgr
local Table_EffectMgr = class("Table_EffectMgr", IDataMgr);

function Table_EffectMgr:FileName()
    return "Txt/Effect.txt";
end

---@return Table_EffectItem
function Table_EffectMgr:GetItemById(id)
    return self.super:GetItemById(id)
end

---@return Table_EffectItem
function Table_EffectMgr:GetItemByIdx(idx)
    return self.super:GetItemByIdx(idx)
end

function Table_EffectMgr:Load(reader)
    local item = Table_EffectItem.new();
    item:Load(reader);
    self.mItemDic[item.Id] = self.mDataCount;
    table.insert(self.mItemList, item);
end

return Table_EffectMgr;